<#setting number_format="#">
<style type="text/css">

.layui-side-menu .layui-nav {
	width: 185px;
}
.layui-side-menu .layui-side-scroll {
    width: 185px;
}
.layui-layout-admin .layui-side {
    width: 187px;
}

.layui-side-menu .layui-nav .layui-nav-item a {
	padding-left: 29px;
}

.layui-side-menu .layui-nav .layui-nav-item .layui-icon {
	left: 10px;
}

.layui-nav-tree .layui-nav-child a {
	color: white !important;
}

.layui-nav .layui-nav-item a {
	color :white;
}

.layui-nav .layui-nav-item a:hover{
	color :#009688;
}
.layui-nav-itemed>a, .layui-nav-tree .layui-nav-title a, .layui-nav-tree .layui-nav-title a:hover {
    color: white !important;
    font-weight: 600;
    opacity: 1;
}

.layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a {
    background-color: #2186d1 !important;
    font-weight: 600;
    opacity: 1;
}

.layui-nav .layui-nav-mored, .layui-nav-itemed>a .layui-nav-more {
	border-color: transparent transparent darkgray;
}
.layui-nav .layui-nav-more {
	border-top-color: darkgray;
}

.layui-nav-itemed>.layui-nav-child {
	background-color: unset !important;
}

.layui-side-menu .layui-nav .layui-nav-item a{
	padding-right: 0px;
}

.layui-side-menu .layui-nav .layui-nav-more {
    right: 14px;
}
</style>
<div class="layui-side layui-side-menu scrollbar" id="sideMenu" style="top:55px;background: linear-gradient(to bottom, #2a5298, #000e28);">
	<div class="layui-side-scroll">
		<ul class="layui-nav layui-nav-tree" lay-shrink="all" style="margin-top:0px;" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
			<#list menuTree.root as firstMenus>
			<li data-name="app" class="layui-nav-item level_1">
				<a href="javascript:;" lay-tips="${firstMenus.text}" lay-direction="2"> 
					<i class="layui-icon ${firstMenus.iconClass}"></i>
				 	<cite>${firstMenus.text}</cite>
				</a>
				<dl class="layui-nav-child">
					<#list firstMenus.children as secondMenu>
					<#if secondMenu.url!=''>
					<dd class="">
						<a href="javascript:void(0)" onclick='menuOnclick("${secondMenu.url}")' data-url="${secondMenu.url}">${secondMenu.text}</a>
					</dd>
					</#if>				
					</#list>
				</dl>
			</li>
			</#list>
		</ul>
	</div>
</div>
<script type="text/javascript">
$(function(){
	var search = location.search.replace('&_top=true','');
	search = search.replace('?_top=true','');
	$('.layui-nav-itemed').removeClass('layui-nav-itemed');
	$('.layui-this').removeClass('layui-this');
	var targetUrl = "${menu!}";
	var menus = $('a[data-url]');
	for(var i=0;i<menus.length;i++){
		var m = $(menus[i]);
		if( targetUrl.startsWith(m.attr('data-url')) ){
			m.addClass('layui-this');
			m.parents('li').addClass('layui-nav-itemed');
		}
	}

	$('.level_1').each(function(index,obj){
		var level_2_menus = $(obj).find('dd');
		if(level_2_menus.length==0){
			$(obj).remove();
		}
	});
	$('#sideMenu').show();
	gotoPage(targetUrl);
	
	//var top = getCookie('_top');
	//$('#sideMenu').scrollTop(top);
});

function menuOnclick(url){
	window.location="/frame/index?group=${menuGroup}&menu="+url
}
function gotoPage(url){
	var scrollTop = $('#sideMenu')[0].scrollTop;
	// 位置写入cookie
	//setCookie('_top',scrollTop);
	//setCookie('_lastRequestUrl',url);
	
	$('#mainContent').attr('src',url);
}
</script>
